
#include <librally.h>
#include <monitor.h>

int rp_rpointd_monitor_create();
int rp_rpointd_monitor_remove();
int rp_rpointd_monitor_read();
int rp_rpointd_monitor_write();
int rp_rpointd_monitor_rename();

//* Function: rp_rpointd_monitor()
//*		register handler 
//*
int rp_rpointd_monitor(char* dir)
{
	struct sigaction act;
	int fd;

	act.sg_sigaction = rp_rpointd_monitor_create;
	sigemptyset(&act.sa_mask);
	act.sa_flags = SA_SIGINFO;
	sigaction(SIGRTMIN, &act, NULL);

	fd = rp_file_open(dir, O_RONLY);
	fcntl(fd, F_SETSIG, SIGRTMIN);
	fcntl(fd, F_NOTIFY, DN_CREATE);	
}
